home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-20 | 2.0 KB | 79 lines | [TEXT/KAHL] |
- /******************************************************************************
- CResListPane.c
-
- A subclass of CArrayPane that displays a list of resources. The
- resource information in an array of structs of type tResourceInfo.
-
- SUPERCLASS = CArrayPane
-
- Copyright © 1991 Symantec Corporation. All rights reserved.
-
-
- ******************************************************************************/
-
- #include "CResListPane.h"
- #include "ResourceStructs.h"
- #include "CArray.h"
- #include "Packages.h"
-
- // fixed offsets for drawing resource info in cells
-
- #define kSizeOffset 50
- #define kNameOffset 100
-
- /******************************************************************************
- IResListPane
-
- Initialization method for CResListPane.
-
- ******************************************************************************/
-
- void CResListPane::IResListPane( CView *anEnclosure, CBureaucrat *aSupervisor,
- short aWidth, short aHeight,
- short aHEncl, short aVEncl,
- SizingOption aHSizing, SizingOption aVSizing)
- {
- CArrayPane::IArrayPane( anEnclosure, aSupervisor, aWidth, aHeight,
- aHEncl, aVEncl, aHSizing, aVSizing);
- }
-
- /******************************************************************************
- DrawCell
-
- Called to draw a single cell. This method retrieves the tResourceInfo
- array entry associated with the cell, and draws the data in the cell.
-
- ******************************************************************************/
-
- void CResListPane::DrawCell( Cell theCell, Rect *cellRect)
- {
- tResourceInfo resInfo;
- short hStart, vStart;
- Str255 buf;
-
- if (!itsArray) return;
-
- itsArray->GetItem( &resInfo, theCell.v + 1);
-
- hStart = cellRect->left + indent.h;
- vStart = cellRect->top + indent.v;
-
- // draw resource ID
-
- MoveTo( hStart, vStart);
- NumToString( resInfo.ID, buf);
- DrawString( buf);
-
- // draw resource size
-
- MoveTo( hStart + kSizeOffset, vStart);
- NumToString( resInfo.size, buf);
- DrawString( buf);
-
- // draw resource name
-
- MoveTo( hStart + kNameOffset, vStart);
- DrawString( resInfo.name);
- }
-
-